import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createPinia } from 'pinia'
import echartsVue from './components/echarts/echarts.vue'
import 'amfe-flexible'
import zh from 'element-plus/es/locale/lang/zh-cn'


const baseSize = 16

function setRem(){
  const scale = document.documentElement.clientWidth / 1920;
  // 设置页面根节点字体大小
  document.documentElement.style.fontSize =
      baseSize * Math.min(scale, 2) + "px";
}

setRem();
// 改变窗口大小时重新设置 rem
window.onresize = function () {
    setRem();
};

 
const store = createPinia()

const app = createApp(App)
//引入全部icon
// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//   app.component(key, component)
// }

app.use(router).use(ElementPlus,{locale: zh,size:'default'})
.use(store)
.component('echarts-vue',echartsVue)
.mount('#app')


